<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../../lib/style.css">
<script type="text/javascript" src="../../lib/ajax.js"></script>
<script type="text/javascript" src="../../lib/window.js"></script>
<title>窗口内容</title>
</head>
<style>
body{ font-size:14px; line-height:150%; font-family:Garamonds,Tahoma; }
</style>
<body>


<div style="text-indent:2em">
    窗口内容，继<a target="_blank" href="窗口创建.html" style="color:#333">窗口创建</a>之后的又一个重要部分！<br /><br />
</div>

<div style="text-indent:2em">
    每一个窗口都应该有一个和用户交互的界面：也许是一个输入表单，也许是一份数据报表等等！而这些界面的构造代码恰恰就是窗口内容的核心数据！但这章我们讲的不是这些界面的代码如何构造，而是讲如何获取这些界面的构造代码的方法......<br /><br />
</div>

<div style="text-indent:2em">
    窗口类 - 成员函数：<a href="javascript:void(0)" onclick="window.location.hash='lfm-wndcls-inner'" style="color:#008ECD;font-weight:bold;">inner(...)</a>
</div>

<br />

<b>1. 窗口内容 - HTML载入</b><br />
<div style="margin-left:1.2em;">
    <div class="viewcode-body">
        <script>document.write('&l'+'t;')</script>script type="application/javascript"<script>document.write('&g'+'t;')</script>
            <div style="margin-left:2em;">
                var wnd = new Wnd( 'wnd-unique-id1', null, {'width':400} ); <br />
                <br />
                wnd.create();<br />
                wnd.buttonAddDefault();<br />
                <br />
                wnd.inner('HTML内容XXX', 'html');<br />
                wnd.show();<br />
            </div>
        <script>document.write('&l'+'t;')</script>/script<script>document.write('&g'+'t;')</script>
        <span style="color:#008ECD">
            [<a href="javascript:void(0)" style="color:#008ECD" onclick="var wnd=new Wnd('wnd-unique-id1',null,{'width':400});wnd.create();wnd.buttonAddDefault();wnd.inner('HTML内容XXX');wnd.show();">演示</a>]
        </span>
    </div>
    <div>
        通过以上的代码，可以创建一个<a target="_blank" href="窗口创建.html" style="color:#333">固定宽度窗口</a>并在客户区显示"HTML内容XXX"！<br />
        [ <a href="javascript:void(0)" onclick="window.location.hash='lfm-wndcls-inner'" style="color:#008ECD">API：窗口类-客户区内容载入</a> ]
    </div>
</div>

<br />

<b>2. 窗口内容 - URL载入</b><br />
<div style="margin-left:1.2em;">
    <div class="viewcode-body">
        <script>document.write('&l'+'t;')</script>script type="application/javascript"<script>document.write('&g'+'t;')</script><br />
            <div style="margin-left:2em;">
                var wnd = new Wnd( 'wnd-unique-id2', null, {'width':400} ); <br />
                <br />
                wnd.create();<br />
                wnd.buttonAddDefault();<br />
                <br />
                wnd.inner('http://www.lengdo.com/about.php', 'url');<br />
                wnd.show();<br />
            </div>
        <script>document.write('&l'+'t;')</script>/script<script>document.write('&g'+'t;')</script>
        <span style="color:#008ECD">
            [<a href="javascript:void(0)" style="color:#008ECD" onclick="var wnd=new Wnd('wnd-unique-id2',null,{'width':400});wnd.create();wnd.buttonAddDefault();wnd.inner('http://www.lengdo.com/about.php','url');wnd.show();">演示</a>]
        </span>
    </div>
    <div>
        通过以上的代码，可以创建一个<a target="_blank" href="窗口创建.html" style="color:#333">固定宽度窗口</a>并在客户区载入 http://www.lengdo.com/about.php 网页的内容！ <br />
        [ <a href="javascript:void(0)" onclick="window.location.hash='lfm-wndcls-inner'" style="color:#008ECD">API：窗口类-客户区内容载入</a> ]
    </div>
    <br />
    <span>说明：</span>
    <div style="margin-left:2em;">
        1.1 URL载入采用异步请求数据，必须加载Ajax对象<br />
        1.2 URL载入不能跨站请求数据<br />
        1.3 载入的HTML代码中的Javascript代码不会被执行
    </div>
</div>

<br />

<b>3. 窗口内容 - 内容重载</b><br />
<div style="margin-left:1.2em;">
    内容载入和内容重载的主要区别在于加载层的类型，内容载入时加载层为填充，内容重载时加载则为浮动！<br />
    <div class="viewcode-body">
        <script>document.write('&l'+'t;')</script>script type="application/javascript"<script>document.write('&g'+'t;')</script><br />
            <div style="margin-left:2em;">
                var wnd = new Wnd( 'wnd-unique-id3', null, {'width':400} ); <br />
                <br />
                wnd.create();<br />
                wnd.buttonAddDefault();<br />
                <br />
                wnd.inner('1. X<script>document.write('&l'+'t;')</script>br /<script>document.write('&g'+'t;')</script>2. X<script>document.write('&l'+'t;')</script>br /<script>document.write('&g'+'t;')</script>3. X<script>document.write('&l'+'t;')</script>br /<script>document.write('&g'+'t;')</script>4. X<script>document.write('&l'+'t;')</script>br /<script>document.write('&g'+'t;')</script>', 'html');<br />
                wnd.show();<br />
                <br />
                alert('点击确定后重载');<br />
                wnd.reinner('http://www.lengdo.com/about.php', 'url');<br />
            </div>
        <script>document.write('&l'+'t;')</script>/script<script>document.write('&g'+'t;')</script>
        <span style="color:#008ECD">
            [<a href="javascript:void(0)" style="color:#008ECD" onclick="wnd_unique_id3()">演示</a>]
        </span>
        <script>
            function wnd_unique_id3()
            {
                var wnd = new Wnd('wnd-unique-id3', null, {'width':400});

                wnd.create();
                wnd.buttonAddDefault();

                wnd.inner('<div style="height:100px">1. X</d'+'iv>', 'html');
                wnd.show();

                alert('点击确定后重载');

                wnd.reinner('http://www.lengdo.com/about.php', 'url');
            }
        </script>
    </div>
    <div>
        通过以上的代码，可以重载窗口的数据。[ <a href="javascript:void(0)" onclick="window.location.hash='lfm-wndcls-reinner'" style="color:#008ECD">API：窗口类-客户区内容重载</a> ]
    </div>
</div>

<br />

<b>X. 附录</b><br />
<div style="margin-left:1.2em;">
    <a href="javascript:void(0)" onclick="var o=document.getElementById('lfm-wndcls-inner');o.style.display=o.style.display=='none'?'':'none'" style="color:#008ECD;">1. API：窗口类-客户区内容载入</a>
    <table style="margin-left:1.2em;padding:5px 0;font-size:12px;" id="lfm-wndcls-inner">
    <tr>
        <th colspan="4" align="left">Wnd.prototype.inner( data, type, attribs );</th>
    </tr>
    <tr style="background:#eee;">
        <td align="center" width="60">@params</td>
        <td align="center" width="30">str</td>
        <td width="100">data</td>
        <td>载入数据</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center">@params</td>
        <td align="center">str</td>
        <td>type</td>
        <td>载入类型(url, html)，默认html</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center">@params</td>
        <td align="center">obj</td>
        <td>attribs</td>
        <td>载入属性</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center"></td>
        <td align="center">bol</td>
        <td>attribs.move</td>
        <td>加载完后窗口自动居中，默认true</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center"></td>
        <td align="center">bol</td>
        <td>attribs.loading</td>
        <td>客户区内容填充加载层，默认true</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center"></td>
        <td align="center">bol</td>
        <td>attribs.complete</td>
        <td>加载完后执行回调函数，默认true</td>
    </tr>
    </table>
</div>

<br />

<div style="margin-left:1.2em;">
    <a href="javascript:void(0)" onclick="var o=document.getElementById('lfm-wndcls-reinner');o.style.display=o.style.display=='none'?'':'none'" style="color:#008ECD;">2. API：窗口类-客户区内容重载</a>
    <table style="margin-left:1.2em;padding:5px 0;font-size:12px;" id="lfm-wndcls-reinner">
    <tr>
        <th colspan="4" align="left">Wnd.prototype.reinner( data, type, attribs );</th>
    </tr>
    <tr style="background:#eee;">
        <td align="center" width="60">@params</td>
        <td align="center" width="30">str</td>
        <td width="100">data</td>
        <td>载入数据</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center">@params</td>
        <td align="center">str</td>
        <td>type</td>
        <td>载入类型(url, html)，默认html</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center">@params</td>
        <td align="center">obj</td>
        <td>attribs</td>
        <td>载入属性</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center"></td>
        <td align="center">bol</td>
        <td>attribs.move</td>
        <td>加载完后窗口自动居中，默认false</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center"></td>
        <td align="center">bol</td>
        <td>attribs.loading</td>
        <td>客户区内容浮显加载层，默认true</td>
    </tr>
    <tr style="background:#eee;">
        <td align="center"></td>
        <td align="center">bol</td>
        <td>attribs.complete</td>
        <td>加载完后执行回调函数，默认false</td>
    </tr>
    </table>
</div>


</body>
</html>
